API Test Generation
You can create and manage API tests directly from the chat. Each action uses a specific API Tests - … agent. You tick the agent in Studio, then describe what you want in plain language.
The API Tests - … agents are installed by your administrator. To check, open Build → Agent Builder and search for API Test: each agent should show Live. If they are missing, see Ask your administrator for the agents.
What you can do from chat
| Action | Agent to tick in Studio | Example prompt |
|---|---|---|
| Generate new test cases from a scenario | API Tests - Generate tests | Write tests for <operation name>: <valid input> should succeed, and a missing <field> must be rejected. |
| Change a draft collection or case | API Tests - Edit draft | Change the <field> in the <case id> body to <value> |
| Run a collection or a case | API Tests - Run tests | Run the <collection name> collection |
| Find out why a case failed | API Tests - Explain failure | Why did <case id> fail? |
| Drive a case from a dataset | API Tests - Map dataset | Use <dataset name> for <case id> |
| Ask about what is set up | API Tests - Answer | Which datasets does <collection name> use? |
| Environments and external sources | API Tests - Shared records | Change the base URL of <environment name> |
Replace the placeholders in angle brackets with names from your own collection. The full list of agents, with what each one can and cannot do, is in The 8 API Test agents.
Before you start
Generating tests needs more than the agent:
- An environment and a collection in API Test. See the Quick start.
- Your API definition (OpenAPI, WSDL or Postman) as a Source document, submitted to the collection with Submit to API test. See Submit to API test.
- For running tests, a published collection.
How to use it
- Open Studio in the left panel and search for
api. - Tick the agent for the job, for example API Tests - Generate tests. You can also tick your collection under API TESTS as extra context. See Studio.
- Check that the chat box shows a chip such as 1 Studios. Without it, the chat uses only the general model and cannot create tests.
- Start a new chat, describe what you want and send it.
- Review the result. Generated tests wait in the collection's Generated tab until you add them.
The usual chat actions, such as exporting the conversation or downloading its log, work on these chats like any other.
For every step in detail, screens, more prompts and troubleshooting, see Generate tests with chat in the API Test Guide.
Looking for test cases in a table, from a requirement document? That is a different feature. See Agent Test Case Format.